package com.ruoyi.project.bid.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.bid.domain.vo.UserDownloadVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.bid.mapper.UserDownloadMapper;
import com.ruoyi.project.bid.domain.UserDownload;
import com.ruoyi.project.bid.service.IUserDownloadService;

/**
 * 用户下载记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-27
 */
@Service
public class UserDownloadServiceImpl implements IUserDownloadService 
{
    @Autowired
    private UserDownloadMapper userDownloadMapper;

    /**
     * 查询用户下载记录
     * 
     * @param id 用户下载记录ID
     * @return 用户下载记录
     */
    @Override
    public UserDownload selectUserDownloadById(Long id)
    {
        return userDownloadMapper.selectUserDownloadById(id);
    }

    /**
     * 查询用户下载记录列表
     * 
     * @param userDownload 用户下载记录
     * @return 用户下载记录
     */
    @Override
    public List<UserDownload> selectUserDownloadList(UserDownload userDownload)
    {
        return userDownloadMapper.selectUserDownloadList(userDownload);
    }

    @Override
    public List<UserDownloadVO> selectUserDownloadOverview(UserDownloadVO userDownloadVO) {
        return userDownloadMapper.userDownloadOverview(userDownloadVO);
    }

    /**
     * 新增用户下载记录
     * 
     * @param userDownload 用户下载记录
     * @return 结果
     */
    @Override
    public int insertUserDownload(UserDownload userDownload)
    {
        userDownload.setCreateTime(DateUtils.getNowDate());
        return userDownloadMapper.insertUserDownload(userDownload);
    }

    /**
     * 修改用户下载记录
     * 
     * @param userDownload 用户下载记录
     * @return 结果
     */
    @Override
    public int updateUserDownload(UserDownload userDownload)
    {
        userDownload.setUpdateTime(DateUtils.getNowDate());
        return userDownloadMapper.updateUserDownload(userDownload);
    }

    /**
     * 批量删除用户下载记录
     * 
     * @param ids 需要删除的用户下载记录ID
     * @return 结果
     */
    @Override
    public int deleteUserDownloadByIds(Long[] ids)
    {
        return userDownloadMapper.deleteUserDownloadByIds(ids);
    }

    /**
     * 删除用户下载记录信息
     * 
     * @param id 用户下载记录ID
     * @return 结果
     */
    @Override
    public int deleteUserDownloadById(Long id)
    {
        return userDownloadMapper.deleteUserDownloadById(id);
    }
}
